/**
 * @Title: Logic.java
 * @Package: com.jason.bluetooth.fingerprint.logic
 * @Descripton: TODO
 * @Author: Jason.Zhang zhangyujn1989ok@gmail.com
 * @Date: 2014年10月21日 上午9:58:26
 * @Version: V1.0
 */
package com.jason.platform.supervision.task;

import android.util.Log;
import com.jason.platform.supervision.BootApp;
import org.kymjs.aframe.http.KJFileParams;
import org.kymjs.aframe.http.KJHttp;
import org.kymjs.aframe.utils.StringUtils;

/**
 * @ClassName: Task
 * @Description: 业务处理的基类
 * @Author: Jason.Zhang zhangyujn1989ok@gmail.com
 * @Date: 2015-7-28 13:48:43
 */
public abstract class Task {

	private static final String TAG = Task.class.getSimpleName();

	/** 任务类型,用来区分不同任务*/
	public int type = -1;
	/** 回调监听器*/
	public TaskListener listener = null;

	/** 是否成功 */
	public boolean isSuccess = false;
	/** 请求参数 */
	public Object param = null;
	/** 响应数据 */
	public Object resData = null;

	/** 返回码*/
	public int rspCode = 0;

	/** 返回码描述 */
	public String rspDesc = "服务器返回失败";

	/** 扩展参数*/
	public int arg1, arg2;


	public String mImei;

	public String mMachId;

	public KJFileParams mParams = new KJFileParams();;

	public KJHttp mKJHttp = new KJHttp();

	public boolean mIsStart = true;

	public Task(){

	}

	public Task(TaskListener listener){
		this.listener = listener;
		this.mImei = BootApp.getInstance().getImei();
		//TODO 一些新机上面可能获取不到imei号码
		Log.i("Logic", "---->mImei:" + mImei);
		if (StringUtils.isEmpty(mImei)) {
			mImei = "864121017006490";
		}
		Log.i(TAG, "mImei:" + mImei);
//		this.mMachId = String.valueOf(BootApp.getInstance().getMachId());
	}

	/***
	 * 方法执行类
	 * @Descripton: TODO
	 * @Param 
	 * @Return $
	 * @Throws
	 */
	public abstract void execute();

}
